<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.soft.entity.UserInfo" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<title>电子商城</title>
		<link href="inc/style.css" rel="stylesheet" type="text/css" />
		<link href="styles/style.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
	<%
		UserInfo ui = new UserInfo();
		if (request.getAttribute("UserInfo") != null)
			ui = (UserInfo) request.getAttribute("UserInfo");
		int flag = (int)request.getSession().getAttribute("flag");
		if (flag == 5)
			out.print("<script>alert('用户信息修改成功！')</script>");
		else if (flag == 6)
			out.print("<script>alert('用户信息修改失败！')</script>");
		else if (flag == 9)
			out.print("<script>alert('原密码输入错误！')</script>");
		else if (flag == 10)
			out.print("<script>alert('新密码与确认密码不一致！')</script>");
		request.getSession().setAttribute("flag", 0);
	%>
		<div id="container">

			<script type="text/javascript">
				function checkLogin() { //判断是否是汉字、字母、数字组成
					var user = document.getElementById("hidden").value;
					if (user == null || user == "") {
						alert("您尚未登录，请先登录！");
					}
				}
			</script>

			<header>

				<div class="nav-bg">
					<div class="container">

						<ul class="nav-top">

							<li><a href="gouwuche.jsp"><i class="iconfont" >&#xe623;</i>购物车0件</a></li>

							<li id="gundong">您 的 满 意 是 我 们 最 大 的 幸 福， 祝 你 购 物 愉 快!</li>

							<li style="float: left;">有 问 题 请 您 及 时 拨 打 24 小 时 服 务 热 线 4 0 0 8 0 0 6 0 0</li>
						</ul>
						<b>  <a > 会员等级
							<c:if test="${user.level eq 1}"><img src="images/tongpai.png"/></c:if>
							<c:if test="${user.level eq 2}"><img src="images/yinpaihuiyuan.png"/></c:if>
							<c:if test="${user.level eq 3}"><img src="images/jinpaihuiyuan.png"/></c:if>
						</a></b>
					</div>
				</div>
				<div class="container">

					<marquee width="500px" style="float: left;">
						<p style="font-size:30px;color:orange; margin-top: 22px;">欢迎您!${user.name}</p>
					</marquee>

				</div>

			</header>
			<div class="nav">
				<div class="container">
					<a href="<c:url value="/GoodsShow"/>">首页</a> |
					<a href="<c:url value="/UserUpdate"/>">会员资料修改</a> |
					<a href="<c:url value="/GouWuCheList"/>">购物车</a> |
					<a href="<c:url value="/OrderList"/>">查看订单</a> |
					<a href="manage1.jsp">后台管理</a> |
					<a href="denglu.jsp">会员登录</a>

				</div>
			</div>

			<div id="content">
				<div class="userinfo">
					<div>
						<font class="red"></font>
					</div>

					<form id="memberModify_action" name="memberRegisterForm" onsubmit="return true;" action="<c:url value="/UserUpdate"/>" method="post">
						<input type="hidden" name="member.id" value="3" id="memberModify_action_member_id" />
						<ul>
							<li><span>用户名：</span><input type="text" name="member.username" value="<%=ui.getId()%>" id="memberModify_action_member_username" disabled="disabled"/>
								<font class="red"> *</font>
							</li>
							<li><span>真实姓名：</span><input type="text" name="member.realname" value="<%=ui.getName()%>" id="memberModify_action_member_realname" />
								<font class="red"> *</font>
							</li>
							<li style="width:100%"><span>原密码：</span><input type="password" name="member.password" id="memberModify_action_member_password" />
								<font class="red"> *</font>

							</li>

							<li><span>新密码：</span><input type="password" name="newpassword" id="memberModify_action_newpassword" />
								<font class="red">*</font>

							</li>
							<li><span>确认新密码：</span><input type="password" name="renewpassword" id="memberModify_action_renewpassword" />
								<font class="red"> *</font>
							</li>
							<li><span>所在城市：</span><input type="text" name="member.city" value="<%=ui.getAddress()%>" id="memberModify_action_member_city" />
								<%--<li><span>联系地址：</span><input type="text" name="member.address" value="??863???" id="memberModify_action_member_address" />--%>
									<li><span>邮政编码：</span><input type="text" name="member.postcode" value="<%=ui.getPostalCode()%>" id="memberModify_action_member_postcode" />
										<li><span>证件号码：</span><input type="text" name="member.cardno" value="<%=ui.getIdNumber()%>" id="memberModify_action_member_cardno" />
											<font class="red"> *</font>
										</li>
										<li><span>证件类别：</span>
											<input type="radio" name="member.cardtype" <c:if test="<%=ui.getIdType() == 0%>"> checked="checked"</c:if> id="memberModify_action_member_cardtype身份证" value="0" /><label for="memberModify_action_member_cardtype身份证">身份证</label>
											<input type="radio" name="member.cardtype" <c:if test="<%=ui.getIdType() == 1%>"> checked="checked"</c:if> id="memberModify_action_member_cardtype军官证" value="1" /><label for="memberModify_action_member_cardtype军官证">军官证</label>
											<input type="radio" name="member.cardtype" <c:if test="<%=ui.getIdType() == 2%>"> checked="checked"</c:if> id="memberModify_action_member_cardtype学生证" value="2" /><label for="memberModify_action_member_cardtype学生证">学生证</label>

										</li>
										<li><span>联系电话：</span><input type="text" name="member.tel" value="<%=ui.getTelephone()%>" id="memberModify_action_member_tel" />
											<li><span>Email:</span><input type="text" name="member.email" value="<%=ui.getEmail()%>" id="memberModify_action_member_email" />
												<font class="red"> *</font>
											</li>
											<li class="button_img">
												<input type="image" src="images/12.gif" style="CURSOR:hand"/>
												<%--<img src="images/12.gif" onclick="document.memberRegisterForm.submit();" style="CURSOR:hand" />--%>
												<img src="images/13.gif" onclick="document.memberRegisterForm.reset();" style="CURSOR:hand" />
											</li>
						</ul>
					</form>

				</div>
			</div>
		</div>
	</body>

</html>